package com.mes.cloud.web.productpricegroup;

import com.mes.cloud.api.dto.request.productpricegroup.ProductPriceGroupCustomerGroupBatchDeleteRequest;
import com.mes.cloud.api.dto.request.productpricegroup.ProductPriceGroupCustomerGroupBindCustomerGroupRequest;
import com.mes.cloud.api.dto.request.productpricegroup.ProductPriceGroupCustomerGroupPageListRequest;
import com.mes.cloud.api.dto.response.productpricegroup.ProductPriceGroupCustomerGroupCustomerGroupDto;
import com.mes.cloud.common.CommPager;
import com.mes.cloud.common.JsonResult;
import com.mes.cloud.service.productpricegroup.ProductPriceGroupCustomerGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author wxm
 * @version 2019-09-24 14:49:07
 * @email xiaomin.wu1@pactera.com
 */
@Api(tags = "产品价格组-产品客户组关联", value = "产品价格组-产品客户组关联接口")
@RestController
@RequestMapping(value = "/productPriceGroupCustomerGroup")
public class ProductPriceGroupCustomerGroupController  {

    private ProductPriceGroupCustomerGroupService productPriceGroupCustomerGroupService;

    @Autowired
    public ProductPriceGroupCustomerGroupController(ProductPriceGroupCustomerGroupService productPriceGroupCustomerGroupService) {
        this.productPriceGroupCustomerGroupService = productPriceGroupCustomerGroupService;
    }

    /**
     * 功能: 产品价格组-产品客户组关联分页查询
     *
     * @param productPriceGroupCustomerGroupPageListRequest
     * @return JsonResult<CommPager<ProductPriceGroupCustomerGroupDto>>
     */
    @ApiOperation(value = "产品价格组-产品客户组关联分页查询", notes = "产品价格组-产品客户组关联分页查询")
    @PostMapping(value = "/pageList")
    public JsonResult<CommPager<ProductPriceGroupCustomerGroupCustomerGroupDto>> pageList(@Valid @RequestBody ProductPriceGroupCustomerGroupPageListRequest productPriceGroupCustomerGroupPageListRequest) {
        return productPriceGroupCustomerGroupService.pageList(productPriceGroupCustomerGroupPageListRequest);
    }

    /**
     * 功能: 产品价格组-绑定客户组
     *
     * @param productPriceGroupCustomerGroupBindCustomerGroupRequestList
     * @return JsonResult
     */
    @ApiOperation(value = "产品价格组-绑定客户组", notes = "产品价格组-绑定客户组")
    @PostMapping(value = "/bindCustomerGroup")
    public JsonResult bindCustomerGroup(@Valid @RequestBody ProductPriceGroupCustomerGroupBindCustomerGroupRequest productPriceGroupCustomerGroupBindCustomerGroupRequestList) {
        return productPriceGroupCustomerGroupService.bindCustomerGroup(productPriceGroupCustomerGroupBindCustomerGroupRequestList);
    }

    /**
     * 功能: 产品价格组-批量删除
     *
     * @param productPriceGroupProductBatchDeleteRequest
     * @return JsonResult
     */
    @ApiOperation(value = "产品价格组-批量删除", notes = "产品价格组-批量删除")
    @PostMapping(value = "/batchDelete")
    public JsonResult batchDelete(@Valid @RequestBody ProductPriceGroupCustomerGroupBatchDeleteRequest productPriceGroupProductBatchDeleteRequest) {
        return productPriceGroupCustomerGroupService.batchDelete(productPriceGroupProductBatchDeleteRequest);
    }

}
